package com.jsc.stuconsumer.controller;

import ch.qos.logback.classic.Logger;
import com.jsc.stuconsumer.feign.StuBlogService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
@RefreshScope
public class ConsumerController {
    private Logger logger = (Logger) LoggerFactory.getLogger(ConsumerController.class);

    @Autowired
    private StuBlogService stuBlogService;

    @GetMapping("callStuBlog")
    public void callStuBlog(){
        logger.info("consumer begin:");
        String say = stuBlogService.sayHello();
        System.out.println("say: "+say);
        logger.info("consumer end:");

    }
}
